package com.g.ocache.event;

import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;

import com.g.ocache.Store;


/**
 * 
 * @author Jingqi Xu
 */
public class StoreEvent<K, V> {
	//
	private final StoreEventType type;
	
	//
	private K key;
	private V value;
	private Store<K, V> store;

	/**
	 * 
	 */
	public StoreEvent(StoreEventType type) {
		this.type = type;
	}
	
	/**
	 * 
	 */
	public String toString() {
		return new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE)
		.append("type", type)
		.append("key", key)
		.append("value", value).toString();
	}
	
	/**
	 * 
	 */
	public StoreEventType getType() {
		return type;
	}
	
	public K getKey() {
		return key;
	}

	public void setKey(K key) {
		this.key = key;
	}

	public V getValue() {
		return value;
	}

	public void setValue(V value) {
		this.value = value;
	}
	
	public Store<K, V> getStore() {
		return store;
	}

	public void setStore(Store<K, V> store) {
		this.store = store;
	}
}
